home *** CD-ROM | disk | FTP | other *** search
- /* Send text from TLNG to PageLiner */
- /* Change Pagestream3: to PageStream4: */
- /* if you are using PageStream4!!! */
- /* PL-V1.0 © 13.03.99 by Jochen Grus */
-
- OPTIONS RESULTS
- TRACE OFF
-
- /* Make sure rexx support is opened */
- IF ~SHOW('L','rexxsupport.library') THEN
- CALL ADDLIB('rexxsupport.library',0,-30)
-
-
- /* set the default PageLiner path , should be changed to 4 if you are using PGS4*/
- plpath='PageStream3:PageLiner'
- preffile='PageStream3:SendtoPageLiner.prefs'
-
- /* If PageLiner doesn't exist in the default path, check SendtoPageLiner.prefs */
- if ~exists(plpath) then do
- if open(.ifile, preffile, 'R') then do
- plpath=readln(.ifile)
- call close(.ifile)
- askuser='no'
- end
- else do
- askuser='yes'
- end
- /* If PageLiner doesn't exist in the set pref path, ask the user where it is */
- if ~exists(plpath) | askuser='yes' then do
- getfile TITLE "'Please locate PageLiner'" load path "'PageStream3:'" file 'PageLiner' posbutton 'Ok' negbutton 'Cancel'
- if RC=10 then signal cancel
- plpath=result
- if open(.ifile, preffile, 'W') then do
- call writeln(.ifile, plpath)
- call close(.ifile)
- end
- end
- end
-
-
- /* Run PageLiner */
- ADDRESS COMMAND
- 'run >nil:' PLpath
-
- /* Wait until the ARexx port shows up */
- do 20
- if ~show(P, 'PAGELINER') then call delay(50)
- end
-
- /* If the ARexx port didn't show up, alert the user and exit */
- if ~show(P, 'PAGELINER') then do
- ADDRESS 'PAGESTREAM'
- allocarexxrequester '"Send to Editor Error!"' 368 59
- reqhandle=result
- addarexxgadget reqhandle EXIT 286 42 70 label "_Exit"
- Exithandle=result
- addarexxgadget reqhandle TEXT 8 10 352 border none string "'PageLiner could not be started.'"
- doarexxrequester reqhandle
- freearexxrequester reqhandle
- 'refresh continue'
- 'lockinterface false'
- EXIT
- end
-
- ADDRESS 'PAGELINER'
- 'open ram:clipboards/0'
- 'cursor down'
-
- /* Wait for the user to finish in PageLiner */
- do forever
- if show(P, 'PAGELINER') then do
- 'getarticle ram:clipboards/0'
- if rc=0 then call delay(50)
- else signal update
- end
- else signal update
- end
-
- /* Update PageStream and exit */
-
- 'inserttext file ram:clipboards/0'
-
- /* deselect the text if rquired */
- if sID=eID then selecttext none
-
- signal cancel
-
- CANCEL:
- ADDRESS 'PAGESTREAM'
- 'refresh continue'
- 'lockinterface false'
- ADDRESS COMMAND
- EXIT
-